/** 
 * Project Name:Food_Sysrem 
 * File Name:setInfo.java 
 * Package Name:priv.web.control 
 * Date:2018年5月30日下午3:16:45 
 * Copyright (c) 2018, Fkuennh All Rights Reserved. 
 * 
*/  
  
package priv.web.control;  
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

import priv.web.util.ReviewJDBCUtil;

import com.alibaba.fastjson.JSON;

public class QueryInfo extends HttpServlet{
	private static final Logger logger = Logger.getLogger(QueryInfo.class);
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		try {
			List<Map<String, Object>> result = ReviewJDBCUtil.query("select * from food_users");
			resp.setContentType("application/json;charset=utf-8");
			resp.getWriter().write(JSON.toJSONString(new Package(1,"",result)));
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
	